package chapter3.No3_1_等待和通知机制.c等待通知机制的实现.demo3;

/**
 * Created by Administrator on 2016/11/16.
 */
public class ThreadA extends Thread {
    Object lock;

    public ThreadA(Object lock) {
        this.lock = lock;
    }

    @Override
    public void run() {
        try {
            synchronized (lock) {
                System.out.println("开始wait：" + System.currentTimeMillis());
                lock.wait();
                System.out.println("结束wait：" + System.currentTimeMillis());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
